var t = getApp();

Page({
    data: {
        member_list: [],
        show_index: -1,
        isLoadMore: !0,
        page: 1,
        total_page: 0,
        id: ""
    },
    onLoad: function(t) {
        t.id && this.setData({
            id: t.id
        }), this.getData();
    },
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.commission-activity.api.activity-inquire.join-people");
        t._postNetWork({
            url: e,
            showToastIn: !1,
            data: {
                page: this.data.page,
                activity_id: this.data.id
            },
            success: function(t) {
                var e = t.data;
                if (1 == e.result) {
                    var i = e.data;
                    a.setData({
                        member_list: i.data,
                        page: i.current_page,
                        total_page: i.last_page
                    });
                } else wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t.msg);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.isLoadMore ? this._getMoreData() : console.log("没有更多数据");
    },
    _getMoreData: function() {
        var a = this, e = {
            page: this.data.page,
            activity_id: this.data.id
        }, i = "";
        a.data.isLoadMore = !1, this.data.page >= this.data.total_page || (this.data.page = this.data.page + 1, 
        i = t.getNetAddresss("plugin.commission-activity.api.activity-inquire.join-people"), 
        t._postNetWork({
            url: i,
            showToastIn: !1,
            data: e,
            success: function(t) {
                var e = t.data;
                if (1 == e.result) {
                    var i = e.data.data;
                    a.setData({
                        isLoadMore: !0,
                        member_list: a.data.member_list.concat(i)
                    });
                } else a.setData({
                    page: a.data.page - 1,
                    isLoadMore: !1
                });
            },
            fail: function(t) {
                console.log(t.msg);
            }
        }));
    },
    showDetial: function(t) {
        var a = t.currentTarget.dataset.index;
        this.setData({
            show_index: a
        });
    },
    onShareAppMessage: function() {}
});